import React, { Fragment } from 'react';
import './App.css';
import routesConfig from "./router/routes"
//引入自己定义的守卫Hook
import useRouteWithGuard from "./router/useRouteWithGuard"
import { Spin } from 'antd';
import Loading from "@/components/Loading"

import { useRoutes } from "react-router-dom"

//引入布局组件

import Layout from "@/Layout"

const App = () => {
  let Element = useRouteWithGuard('wf-token', routesConfig)
  // fetch("/api/data/index.json")
  let Element2 = useRoutes(routesConfig)
  return (
    <Fragment>
      <Layout>
          {Element}
      </Layout>
    </Fragment>
  )
}




export default App;